1 var signin = document.getElementById("sign_in");
2 if(typeof signin != 'undefined' && signin){
3 signin.href = signin.href + "?back_url=" + encodeURIComponent(window.location);
6 var signout = document.getElementById('sign_out');
7 if(typeof signout != 'undefined' && signout){
8 signout.href = signout.href + "?back_url=" + encodeURIComponent(window.location);
11 function getCookie(cookie_name) {
12 var start_pos = document.cookie.indexOf(cookie_name + "="); //start cookie name
13 if (start_pos != -1) {
14 start_pos = start_pos + cookie_name.length+1; //start cookie value
15 var end_pos = document.cookie.indexOf(";", start_pos);
17 end_pos = document.cookie.length;
19 return decodeURIComponent(document.cookie.substring(start_pos, end_pos));
26 var c = getCookie('WebCubbyUser');
27 c = decodeURIComponent(decodeURIComponent(c));
28 lre = /.*logged-in\=(\w*);.*/;
29 ure = /.*my-name\=([\w|\-|\.|\ |\@|\+]*);.*/;
34 if(l && l[1] && l[1] === 'true' ) {
37 var myncbi_username = document.getElementById("myncbiusername");
38 var uname = document.getElementById('mnu');
40 if (typeof uname != 'undefined') {
41 uname.appendChild(document.createTextNode(u[1].replace(plus, ' ')));
42 myncbi_username.style.display = "inline";
44 var signin = document.getElementById("sign_in");
45 signin.style.display = "none";
47 var signout = document.getElementById("sign_out");
48 signout.style.display = "inline";
50 var myncbi = document.getElementById('myncbi');
51 myncbi.style.display='inline';
60 if (typeof $.fn.ncbipopper == "function") {
61 $('#info .external').each( function(){
62 var $this = $( this );
65 destSelector: '#external-disclaimer',
66 isDestElementCloseClick: false,
67 openAnimation: 'none',
68 closeAnimation: 'none',
69 isTriggerElementCloseClick: false,
70 triggerPosition: 'bottom center',
71 destPosition: 'top center',
80 if(typeof jQuery !== 'undefined' && jQuery.ui){
81 var version = jQuery.ui.jig.version;
82 var pieces = version.split(".");
83 if(pieces[0] >= 1 && pieces[1] >= 11){
84 if(pieces[1] == 11 && pieces[2] && pieces[3] >= 2){
85 jQuery("#sign_in").click(function(e){
86 if(typeof jQuery.ui.jig.requiresLogin !== 'undefined'){
88 jQuery.ui.jig.requiresLogin();